/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package shared;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *
 * @author latata_2
 */
public class MakaoPackage implements Serializable {

    /**
     * Komenda "logowanie". Jedna wartość - login.
     */
    public final static int LOGIN = 1;
    public final static int LOGIN_RESPONSE = 2;
    public final static int ERROR = 3;
    public static int GAME_FINISHED = 4;
    public final static int GAME_INFO = 5;
    
    public final static int GET_CARDS = 1;
    public final static int WAIT_TURNS = 2;
    //public final static int 
    private int command = -1;
    private ArrayList<String> values = null;
    private GameInfo gameInfo;
    private MyCards myCards = null;
    private ThrowCards thorwCards = null;
    private boolean getCards = false;
    private boolean waitTurns = false;

    public MakaoPackage(int command, ArrayList<String> values) {
        this.command = command;
        this.values = values;
    }

    public MakaoPackage(int command, GameInfo gameInfo, MyCards myCards) {
        this.command = command;
        this.gameInfo = gameInfo;
        this.myCards = myCards;
    }

    public MakaoPackage(ThrowCards throwCards) {
        this.thorwCards = throwCards;
    }

    public MakaoPackage(int command) {
        if (command == GET_CARDS) {
            this.getCards = true;
        } else if (command == WAIT_TURNS) {
            this.waitTurns = true;
        }
    }

    public MyCards getMyCards() {
        return myCards;
    }

    public int getCommand() {
        return command;
    }

    public ArrayList<String> getValues() {
        return values;
    }

    public GameInfo getGameInfo() {
        return gameInfo;
    }

    public boolean getGetCards() {
        return getCards;
    }

    public boolean getWaitTurns() {
        return waitTurns;
    }

    public ThrowCards getThorwCards() {
        return thorwCards;
    }

    @Override
    public String toString() {
        return gameInfo.toString();
    }
}